package singlestat
Import Path
github.com/K-Phoen/grabana/singlestat (on go.dev)
Dependency Relation
imports 9 packages, and imported by one package
Involved Source Files
singlestat.go
Package-Level Type Names (total 5)
Option represents an option that can be used to configure a single stat panel.
func ColorBackground() Option
func Colors(values [3]string) Option
func ColorValue() Option
func DataSource(source string) Option
func Decimals(count int) Option
func Description(content string) Option
func FullSparkLine() Option
func Height(height string) Option
func Links(panelLinks ...links.Link) Option
func Postfix(postfix string) Option
func PostfixFontSize(size string) Option
func Prefix(prefix string) Option
func PrefixFontSize(size string) Option
func RangesToText(mapping []RangeMap) Option
func Repeat(repeat string) Option
func RepeatDirection(direction sdk.RepeatDirection) Option
func Span(span float32) Option
func SparkLine() Option
func SparkLineColor(color string) Option
func SparkLineFillColor(color string) Option
func SparkLineYMax(value float64) Option
func SparkLineYMin(value float64) Option
func Thresholds(values [2]string) Option
func Transparent() Option
func Unit(unit string) Option
func ValueFontSize(size string) Option
func ValuesToText(mapping []ValueMap) Option
func ValueType(valueType StatType) Option
func WithGraphiteTarget(query string, options ...graphite.Option) Option
func WithInfluxDBTarget(query string, options ...influxdb.Option) Option
func WithPrometheusTarget(query string, options ...prometheus.Option) Option
func WithStackdriverTarget(target *stackdriver.Stackdriver) Option
func New(title string, options ...Option) (*SingleStat, error)
func github.com/K-Phoen/grabana/row.WithSingleStat(title string, options ...Option) row.Option
RangeMap allows to map a range of values into explicit text.
From string
Text string
To string
func RangesToText(mapping []RangeMap) Option
SingleStat represents a single stat panel.
Builder *sdk.Panel
func New(title string, options ...Option) (*SingleStat, error)
Package-Level Functions (total 33)
ColorBackground will show the threshold's colors in the background.
Colors define which colors will be applied to the single value based on the
threshold levels.
ColorValue will show the threshold's colors on the value itself.
DataSource sets the data source to be used by the panel.
Decimals sets the number of decimals that should be displayed.
Description annotates the current visualization with a human-readable description.
FullSparkLine displays a full height spark line summary of the series in
addition to the single stat.
Height sets the height of the panel, in pixels. Example: "400px".
Links adds links to be displayed on this panel.
New creates a new single stat panel.
Postfix sets the text used as postfix of the value.
PostfixFontSize sets the size used for the postfix text (eg: "110%")
Prefix sets the text used as prefix of the value.
PrefixFontSize sets the size used for the prefix text (eg: "110%").
RangesToText allows to translate the value of the summary stat into explicit
text.
Repeat configures repeating a panel for a variable
RepeatDirection configures repeating vertical or horizontal
Span sets the width of the panel, in grid units. Should be a positive
number between 1 and 12. Example: 6.
SparkLine displays the spark line summary of the series in addition to the
single stat.
SparkLineColor sets the line color of the spark line.
SparkLineFillColor sets the color the spark line will be filled with.
SparkLineYMax defines the largest value expected on the Y axis of the spark line.
SparkLineYMin defines the smallest value expected on the Y axis of the spark line.
Thresholds change the background and value colors dynamically within the
panel, depending on the Singlestat value. The threshold is defined by 2
values which represent 3 ranges that correspond to the three colors directly
to the right.
Transparent makes the background transparent.
Unit sets the unit of the data displayed on this axis.
ValueFontSize sets the font size used to display the value (eg: "100%").
ValuesToText allows to translate the value of the summary stat into explicit
text.
ValueType configures how the series will be reduced to a single value.
WithGraphiteTarget adds a Graphite target to the graph.
WithInfluxDBTarget adds an InfluxDB target to the graph.
WithPrometheusTarget adds a prometheus query to the graph.
WithStackdriverTarget adds a stackdriver query to the graph.
Package-Level Constants (total 10)
Avg will return the average of all the non-null values in the series.
Current will return the last value in the series. If the series ends on
null the previous value will be used.
Delta will return the total incremental increase (of a counter) in the
series. An attempt is made to account for counter resets, but this will
only be accurate for single instance metrics. Used to show total
counter increase in time series.
Diff will return difference between ‘current’ (last value) and ‘first’..
First will return the first value in the series.
Max will return the largest value in the series.
Min will return the smallest value in the series.
Name will return the name value in the series.
Range will return the difference between ‘min’ and ‘max’. Useful to
show the range of change for a gauge..
Total will return the sum of all the non-null values in the series.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |